import { NgModule } from '@angular/core';
import { RouterModule, Routes } from '@angular/router';
import { IntostorageComponent } from './pages/intostorage/intostorage.component';
import { IntostorageDetailComponent } from './pages/intostorage-detail/intostorage-detail.component';
import { AllocationDetailComponent } from './pages/allocation-detail/allocation-detail.component';
import { AllocationComponent } from './pages/allocation/allocation.component';

import { SalesComponent } from './pages/sales/sales.component';
import { SalesDetailComponent } from './pages/sales-detail/sales-detail.component';



const routes: Routes = [
    {
        path: 'intostorage',
        component: IntostorageComponent,
        data: { breadcrumbs: [{ title: '仓库入库列表' }] },
        children: [
            {
                path: 'detail/:id',
                component: IntostorageDetailComponent,
                data: { breadcrumbs: [{ title: '仓库入库列表', path: '/intostorage/intostorage' }, { title: '入库详情' }] },
            },
            {
                path: 'detail',
                component: IntostorageDetailComponent,
                data: { breadcrumbs: [{ title: '仓库入库列表', path: '/intostorage/intostorage' }, { title: '添加入库' }] },
            },
        ]
    },
    {
        path: 'allocation',
        component: AllocationComponent,
        children: [
            {
                path: 'detail', component: AllocationDetailComponent, data: {
                    breadcrumbs: [{ title: '新增调拨入库列表', path: '/intostorage/allocation' }, { title: '添加新增调拨入库' }]
                },
            },
            {
                path: 'detail/:id', component: AllocationDetailComponent, data: {
                    breadcrumbs: [{ title: '新增调拨入库列表', path: '/intostorage/allocation' }, { title: '新增调拨入库详情' }]
                }
            },
        ],
        data: {
            breadcrumbs: [{ title: '新增调拨入库列表' }]
        }
    },
    {
        path: 'sales',
        component: SalesComponent,
        children: [
            {
                path: 'detail', component: SalesDetailComponent, data: {
                    breadcrumbs: [{ title: '新增退货销售列表', path: '/intostorage/sales' }, { title: '添加新增退货销售' }]
                },
            },
            {
                path: 'detail/:id', component: SalesDetailComponent, data: {
                    breadcrumbs: [{ title: '新增退货销售列表', path: '/intostorage/sales' }, { title: '新增退货销售详情' }]
                }
            },
        ],
        data: {
            breadcrumbs: [{ title: '新增退货销售列表' }]
        }
    },
];

export const declarationComponents = [
    IntostorageComponent,
    IntostorageDetailComponent,
    AllocationComponent,
    // AcceptanceComponent,
    SalesComponent,
    SalesDetailComponent,
    AllocationDetailComponent,
];

export const entryComponents = [
];

@NgModule({
    imports: [
        RouterModule.forChild(routes)
    ],
    exports: [
        RouterModule
    ]
})
export class IntostorageRoutingModule { }
